<?php

namespace App\Admin\Extensions;

use App\Model\UserProfilePersonal;
use Encore\Admin\Admin;

class PersonalProfileVerify extends BaseAction
{
    protected function render()
    {
        Admin::script($this->script($this->actionUrl));
        $okbtn = $this->buildButton('ok', '通过', ['id' => $this->id, 'status' => UserProfilePersonal::STATUS_OK]);
        $failbtn = $this->buildButton('fail', '不通过', ['id' => $this->id, 'status' => UserProfilePersonal::STATUS_FAIL]);
        $delbtn = $this->buildButton('fail', '删除', ['id' => $this->id, 'status' => UserProfilePersonal::STATUS_DEL]);
        $str = '';
        if ($this->row->flag == UserProfilePersonal::STATUS_ING) {
            $str  = [$okbtn, $failbtn, $delbtn];
        } elseif ($this->row->flag == UserProfilePersonal::STATUS_OK) {
            $str  = [$failbtn, $delbtn];
        } else {
            $str  = [$okbtn, $delbtn];
        }
        return implode('<br/><br/>', $str);
    }
}
